package com.crh.dao.impl;

import java.sql.Connection;
import java.sql.Statement;

import com.crh.bean.Goods;
import com.crh.dao.IGoodsDao;
import com.crh.utils.JdbcUtils;

public class IGoodsDaoImpl implements IGoodsDao {

	@Override
	public boolean addGoods(Goods goods) {

		return false;
	}

	@Override
	public boolean delGoods(int goodId,Connection conn) throws Exception {
		Statement st = null;
		int results = 0;
		try {
			st = conn.createStatement();
			String sql = "delete from t_goods where GOOD_ID = "+goodId;
			results = st.executeUpdate(sql);
		} catch (Exception e) {
			throw e;
		} finally {
			JdbcUtils.free(null, st, conn);
		}
		return results > 0;
	}

}
